#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
const int N = 3e3 + 10;
int ne[N];
int n, k;
string s;
int main()
{
	cin >> n >> k;
	cin >> s;
	string t = s;
	int n = s.size();
	s = " " + s;
	int ma = 0;
	for (int i = 2, j = 0; i <= n; i++) {
		while (j && s[i] != s[j + 1])j = ne[j];
		if (s[i] == s[j + 1])j++;
		ne[i] = j;
		ma = max(ma, ne[i]);
	}
	if (!ma) {
		for (int i = 0; i < k; i++) {
			cout << t;
		}
		return 0;
	}
	int idx = ne[n];
	string temp = t.substr(idx);
	cout << t;
	for (int i = 0; i < k - 1; i++) {
		cout << temp;
	}
	return 0;
}
